package controller;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import entity.Student;
import service.StuService;

/**
 * Servlet implementation class Find
 */
@WebServlet( {"/AdminFindUtils", "/adminfindutils.do"} )
public class AdminFindUtils extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public AdminFindUtils() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		
		response.setContentType("text/html;charset=utf-8");
		request.setCharacterEncoding("utf-8");
		String findutils = request.getParameter("findutils");
					
		if (findutils.equals("findbyabstractname")) {
			response.sendRedirect("findbyabstractname.jsp");
		} else if (findutils.equals("findbyfullname")) {
			response.sendRedirect("findbyfullname.jsp");
		} else if (findutils.equals("findbyno")) {
			response.sendRedirect("findbysno.jsp");
		} else {
			response.sendRedirect("addinfopre.jsp");
		} 		
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
